package com.njbdqn.threetab.demo;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.njbdqn.threetab.dao.PowerDAO;
import com.njbdqn.threetab.domain.Power;
import com.njbdqn.threetab.domain.Userinfos;


public class Demo {
	public static void main(String[] args) {
		ApplicationContext ac
			= new ClassPathXmlApplicationContext("spring.xml");
		PowerDAO pdao = ac.getBean(PowerDAO.class);
		Userinfos us = new Userinfos();
		us.setUserid(1);
		Power p1 = new Power();
		p1.setPowid(2);
		Power p2 = new Power();
		p2.setPowid(2);
		us.getPowers().add(p1);
		us.getPowers().add(p2);
		
		pdao.saveFetchPower(us);
		
	}
}
